import { BaseWindow } from "../../../component/window/BaseWindow";
import { ILayer } from "../../../mvc/interfaces/ILayer";
import { Language } from "../../../../extend/language/Language";
import { DataProvider } from "../../../../fl/data/DataProvider";
import { ObjCreate } from "../common/ObjCreate";
import { CrossTaskTaskDescRender } from "./render/CrossTaskTaskDescRender";
import { CrossTaskServerListRender } from "./render/CrossTaskServerListRender";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
import { EMapPointType } from "../../../../Message/Public/EMapPointType";
import { GTileList } from "../../../../com/mui/controls/GTileList";
import { GButton } from "../../../../com/mui/controls/GButton";
//class CrossTaskWin
    
    export  class CrossTaskWin extends BaseWindow
    {
        constructor(arg1: ILayer=null)
        {
            super(arg1);
            setSize(725, 556);
            this.title = Language.getString(80460);
            this.titleHeight = 27;
            return;
        }

        public set taskList(arg1: DataProvider)
        {
            this._listDesc.dataProvider = arg1;
            return;
        }

        public set serverList(arg1: DataProvider)
        {
            this._listServer.dataProvider = arg1;
            this._listServer.drawNow();
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            ObjCreate.createFlowerBg(17, 39, 692, 380, this);
            ObjCreate.createBg(17, 421, 692, 84, this);
            this._listDesc = ObjCreate.createTileList(55, 52, 640, 366, this);
            this._listDesc.columnWidth = 198;
            this._listDesc.rowHeight = 353;
            this._listDesc.horizontalGap = 12;
            this._listDesc.setStyle("cellRenderer", CrossTaskTaskDescRender);
            this._listServer = ObjCreate.createTileList(28, 427, 720, 75, this);
            this._listServer.rowHeight = 20;
            this._listServer.columnWidth = 128;
            this._listServer.verticalGap = 8;
            this._listServer.horizontalGap = 8;
            this._listServer.setStyle("cellRenderer", CrossTaskServerListRender);
            this._btnEnterSouth = ObjCreate.createGButton(Language.getString(80461), 105, 518, 105, 25, this, "ButtonRed");
            this._btnEnterNorth = ObjCreate.createGButton(Language.getString(80462), 315, 518, 105, 25, this, "ButtonRed");
            this._btnEnterEast = ObjCreate.createGButton(Language.getString(80463), 525, 518, 105, 25, this, "ButtonRed");
            this._btnEnterSouth.addEventListener(flash.events.MouseEvent.CLICK, this.clickSouthHandler);
            this._btnEnterNorth.addEventListener(flash.events.MouseEvent.CLICK, this.clickNorthHandler);
            this._btnEnterEast.addEventListener(flash.events.MouseEvent.CLICK, this.clickEastHandler);
            return;
        }

        /* internal  */onResGot(): void
        {
            return;
        }

        /* internal  */clickSouthHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.CrossTaskSelectGate, EMapPointType._EMapPointTypeCrossCountry1));
            return;
        }

        /* internal  */clickNorthHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.CrossTaskSelectGate, EMapPointType._EMapPointTypeCrossCountry2));
            return;
        }

        /* internal  */clickEastHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.CrossTaskSelectGate, EMapPointType._EMapPointTypeCrossCountry3));
            return;
        }

        /* internal */ /* var */_listDesc: GTileList;

        /* internal */ /* var */_listServer: GTileList;

        /* internal */ /* var */_btnEnterSouth: GButton;

        /* internal */ /* var */_btnEnterNorth: GButton;

        /* internal */ /* var */_btnEnterEast: GButton;
    }
